import request from '@/config/axios'

export interface ContractAssessVO {
  id: number
  orderNumber: string
  productCode: string
  productName: string
  customerName: string
  salesDepartment: string
  generalManagement: string
  technicalSection: string
  engineeringDepartment: string
  purchasingDepartment: string
  warehouse: string
  productionDepartment: string
  qualityInspectionDepartment: string
  creatorName: string
}

// 查询单合同批次考核列表
export const getContractAssessPage = async (params) => {
  return await request.get({ url: `/order/contract-assess/page`, params })
}

// 查询单合同批次考核详情
export const getContractAssess = async (id: number) => {
  return await request.get({ url: `/order/contract-assess/get?id=` + id })
}

// 新增单合同批次考核
export const createContractAssess = async (data: ContractAssessVO) => {
  return await request.post({ url: `/order/contract-assess/create`, data })
}

// 修改单合同批次考核
export const updateContractAssess = async (data) => {
  return await request.put({ url: `/order/contract-assess/update`, data })
}

// 删除单合同批次考核
export const deleteContractAssess = async (id: number) => {
  return await request.delete({ url: `/order/contract-assess/delete?id=` + id })
}

// 导出单合同批次考核 Excel
export const exportContractAssess = async (params) => {
  return await request.download({ url: `/order/contract-assess/export-excel`, params })
}
